package 多线程07_线程池;

import java.util.concurrent.LinkedBlockingQueue;
import java.util.concurrent.ThreadPoolExecutor;
import java.util.concurrent.TimeUnit;

/**
 * Java 自带的线程池
 * @ClassName: TestThread01
 * @Author: AllenSun
 * @Date: 2022/3/18 上午1:46
 */
public class TestThread03 {
    public static void main(String[] args) throws InterruptedException {

        ThreadPoolExecutor threadPool= new ThreadPoolExecutor(10, 15, 60, TimeUnit.SECONDS, new LinkedBlockingQueue<Runnable>());

        threadPool.execute(new Runnable(){

            @Override
            public void run() {
                System.out.println("任务1");
            }

        });

    }
}
